package com.example.replacebooks.mapper;

import com.example.replacebooks.entity.Bookorder;
import com.example.replacebooks.entity.Orders_Bookorder;
import com.example.replacebooks.entity.Params;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface Orders_BookorderMapper extends Mapper<Orders_Bookorder> {
    List<Orders_Bookorder> findBySearch(@Param("params") Params params);

    @Select("select * from orders_bookorder where bookorderid = #{bookorderid}")
    List<Orders_Bookorder> findByBookOrderid(@Param("bookorderid") Integer bookorderid);

    @Update("update orders_bookorder set bookorderid = #{bookorderid},bookid = #{bookid},num = #{num} where id = #{id}")
    void updateByid(Orders_Bookorder orders_bookorder);
}

